UpperAssets = "${UpperAssets}"
#照明开关配置
ENERGY_CONSUMING_EQUIPMENT = "用能设备"
LIGHTING_SWITCH = "照明设备"
Location = "${Location}"
#温度传感器配置
SENSOR_LABEL = "传感器"
TEMPERATURE_TYPE = "温度传感器"
#取%1和1%之间的字符串正则表达式
END_TOPIC = "(?<=\\/)([^/]+)$"
SWITCHLEFT = "(?<=%1\[)(.+?)(?=\]1%)"
SWITCHRIGHT = "(?<=%2\[)(.+?)(?=\]2%)"
SWITCHCENTER = "(?<=%3\[)(.+?)(?=\]3%)"
TEMPERATURE_GET = "(?<=%4\[)(.+?)(?=\]4%)"
STATE = "state"
STATE_LEFT = "state_left"
STATE_RIGHT = "state_right"
STATE_CENTER = "state_center"
SET_STATE = "set_state"
TEMPERATURE = "device_temperature"

#空调红外码配置
SET_STATE_OPEN = "set_state_open"
SET_STATE_CLOSE = "set_state_close"
SET_WINDSPEED_AUTO = "set_windspeed_auto"
SET_WINDSPEED_ONE = "set_windspeed_one"
SET_WINDSPEED_TWO = "set_windspeed_two"
SET_WINDSPEED_THREE = "set_windspeed_three"
SET_WINDSPEED_FOUR = "set_windspeed_four"
SET_WINDSPEED_FIVE = "set_windspeed_five"
SET_WINDSPEED_SIX = "set_windspeed_six"
SET_WINDSPEED_SEVEN = "set_windspeed_seven"
SET_MODE_AUTO = "set_mode_auto"
SET_MODE_COLD = "set_mode_cold"
SET_MODE_HOT = "set_mode_hot"
SET_MODE_DRY = "set_mode_dry"
SET_MODE_FAN = "set_mode_fan"
SET_TEM_T17 = "set_temp_t17"
SET_TEM_T18 = "set_temp_t18"
SET_TEM_T19 = "set_temp_t19"
SET_TEM_T20 = "set_temp_t20"
SET_TEM_T21 = "set_temp_t21"
SET_TEM_T22 = "set_temp_t22"
SET_TEM_T23 = "set_temp_t23"
SET_TEM_T24 = "set_temp_t24"
SET_TEM_T25 = "set_temp_t25"
SET_TEM_T26 = "set_temp_t26"
SET_TEM_T27 = "set_temp_t27"
SET_TEM_T28 = "set_temp_t28"
SET_TEM_T29 = "set_temp_t29"
SET_TEM_T30 = "set_temp_t30"

BROKERCONF = {
        "broker": {
            "name": "Default Local Broker",
            "host": "127.0.0.1",
            "port": 1883,
            "clientId": "ThingsBoard_gateway",
            "version": 5,
            "maxMessageNumberPerWorker": 10,
            "maxNumberOfWorkers": 100,
            "sendDataOnlyOnChange": False,
            "security": {
                "type": "basic",
                "username": "juji1234",
                "password": "juji1234"
            }
        }
    }


#zigbee2mqtt配置
ZIGBEE2MQTT_SWITCH_MAPPING = {
            "topicFilter": "zigbee2mqtt/",
            "converter": {
                "deviceTypeJsonExpression": ENERGY_CONSUMING_EQUIPMENT,
                "deviceLabelJsonExpression": LIGHTING_SWITCH,
                "timeout": 6000,
                "deviceNameTopicExpression": "(?<=\\/)([^/]+)$",
                "type": "json",
                "attributes": [
                    {
                        "type": "string",
                        "key": "UpperAssets",
                        "value": UpperAssets
                    },
                    {
                        "type": "string",
                        "key": "Location",
                        "value": Location
                    }
                ],
                "timeseries": [
                    {
                        "type": "onofftoint",
                        "key": "RunSign",
                        "value": "${state}"
                    },
                    {
                        "type": "string",
                        "key": "Temperature",
                        "value": "${device_temperature}"
                    },
                    {
                        "type": "int",
                        "key": "LinkQ",
                        "value": "${linkquality}"
                    }
                ]
            }
        }

ZIGBEE2MQTT_TEMPERATURE_MAPPING = {
            "topicFilter": "zigbee2mqtt/",
            "converter": {
                "deviceTypeJsonExpression": TEMPERATURE_TYPE,
                "deviceLabelJsonExpression": SENSOR_LABEL,
                "timeout": 6000,
                "deviceNameTopicExpression": "(?<=\\/)([^/]+)$",
                "type": "json",
                "attributes": [
                    {
                        "type": "string",
                        "key": "UpperAssets",
                        "value": UpperAssets
                    },
                    {
                        "type": "string",
                        "key": "Location",
                        "value": Location
                    }
                ],
                "timeseries": [
                    {
                        "type": "double",
                        "key": "Temperature",
                        "value": "${temperature}"
                    },
                    {
                        "type": "int",
                        "key": "LinkQ",
                        "value": "${linkquality}"
                    }
                ]
            }
        }

ZIGBEE2MQTT_IR_AIRCONDITION_MAPPING =  {
            "topicFilter": "zigbee2mqtt/空调设备/+",
            "converter": {
                "deviceTypeJsonExpression": "风机盘管",
                "deviceLabelJsonExpression": "用能设备",
                "timeout": 6000,
                "deviceNameTopicExpression": "(?<=\\/)([^/]+)$",
                "type": "json",
                "attributes": [
                    {
                        "type": "string",
                        "key": "UpperAssets",
                        "value": "10幢3楼风机盘管系统,10幢3楼"
                    },
                    {
                        "type": "string",
                        "key": "Location",
                        "value": "10幢3楼"
                    }
                ],
                "timeseries": [
                    {
                        "type": "onofftoint",
                        "key": "RunSign",
                        "value": "${state}"
                    },
                    {
                        "type": "int",
                        "key": "LinkQ",
                        "value": "${linkquality}"
                    }
                ]
            }
        }

ZIGBEE2MQTT_AIRCONDITION_MAPPING =  {
        "topicFilter": "zigbee2mqtt/空调面板/+",
        "converter": {
            "deviceTypeJsonExpression": "风机盘管",
            "deviceLabelJsonExpression": "用能设备",
            "timeout": 6000,
            "deviceNameTopicExpression": "(?<=\\/)([^/]+)$",
            "type": "json",
            "attributes": [
            {
                "type": "string",
                "key": "Location",
                "value": "${location}"
            }
            ],
            "timeseries": [
            {
                "type": "int",
                "key": "LinkQ",
                "value": "${linkquality}"
            },
            {
                "type": "string",
                "key": "SetAirVolume",
                "value": "${setairvolume}"
            },
            {
                "type": "string",
                "key": "SetTemperature",
                "value": "${settemperature}"
            },
            {
                "type": "string",
                "key": "WorkMode",
                "value": "${workmode}"
            },
            {
                "type": "onofftoint",
                "key": "RunSign",
                "value": "${state}"
            },
            {
                "type": "string",
                "key": "Temperature",
                "value": "${temperature}"
            }
            ]
        }
    }

ZIGBEE2MQTT_SERVERSIDE_RPC =     {
        "deviceNameFilter": ".*",
        "methodFilter": "set_state",
        "requestTopicExpression": "zigbee2mqtt/",
        "valueExpression": "${params}"
    }

IR_SENDER_SERVERSIDE_RPC = {
        "deviceNameFilter": ".*",
        "methodFilter": "none",
        "requestTopicExpression": "zigbee2mqtt/空调设备/${deviceName}/set",
        "valueExpression": "${params}"
    }

AIRCONDITION_SERVERSIDE_RPC = {
        "deviceNameFilter": ".*",
        "methodFilter": "setValue",
        "requestTopicExpression": "zigbee2mqtt/空调面板/${deviceName}/set",
        "valueExpression": "${params}"
    }